package cn.usian.config;


import org.springframework.web.bind.annotation.RestControllerAdvice;


@RestControllerAdvice//全局异常处理
public class GlobalExceptionHandler {

   /* @ExceptionHandler(NameExistsException.class)
    public R  exceptionHandler(NameExistsException e){
            return R.error(e.getMessage()+"已经存在");
    }
    @ExceptionHandler(DishExistsException.class)
    public R DishExistsException (DishExistsException e){
        return R.error(e.getMessage()+"有关联菜品不能删除");
    }

    @ExceptionHandler(CategoryAddException.class)
    public R  CategoryAddException(CategoryAddException e){
        return R.error(e.getMessage()+"已经存在");
    }*/
}
